package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.common.domain.enumclass.Whether;
import org.apache.commons.codec.binary.StringUtils;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by zhangjh on 2016/10/14.
 *
 */
@Entity
@Table(name = "mall_wechat_config")
@DynamicInsert()
@DynamicUpdate()
public class MallWechatConfig extends IDEntityMall {
    @Column(columnDefinition = "longtext comment '应用appid'")
    private String appid;
    @Column(columnDefinition = "longtext comment'应用密钥'")
    private String appSecret;
    @Column(columnDefinition = "longtext comment'第三方公众号应用密钥'")
    private String appid3rd="";
    @Column(columnDefinition = "longtext comment'第三方公众号支付API密钥'")
    private String appSecret3rd="";
    @Column(columnDefinition = "longtext comment'支付API密钥'")
    private String configKey;
    @Column(columnDefinition = "bigint(20) comment'运营商ID'")
    private Long mallId;
    @Column(columnDefinition = "longtext comment'微信支付商户号'")
    private String mchid;
    @Column(columnDefinition = "longtext comment'信息回调地址'")
    private String notifyUrl;
    @Column(columnDefinition = "varchar(255) comment'使用状态'")
    @Enumerated(EnumType.STRING)
    private Whether useStatus=Whether.NO;
    @Column(columnDefinition = "varchar(250) comment '商户微信证书'")
    private String wechatCertificatePath;

    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    public String getAppid3rd() {
        return appid3rd;
    }

    public void setAppid3rd(String appid3rd) {
        this.appid3rd = appid3rd;
    }

    public String getAppSecret() {
        return appSecret;
    }

    public void setAppSecret(String appSecret) {
        this.appSecret = appSecret;
    }

    public String getAppSecret3rd() {
        return appSecret3rd;
    }

    public void setAppSecret3rd(String appSecret3rd) {
        this.appSecret3rd = appSecret3rd;
    }

    public String getConfigKey() {
        return configKey;
    }

    public void setConfigKey(String configKey) {
        this.configKey = configKey;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public String getMchid() {
        return mchid;
    }

    public void setMchid(String mchid) {
        this.mchid = mchid;
    }

    public String getNotifyUrl() {
        return notifyUrl;
    }

    public void setNotifyUrl(String notifyUrl) {
        this.notifyUrl = notifyUrl;
    }

    public Whether getUseStatus() {
        return useStatus;
    }

    public void setUseStatus(Whether useStatus) {
        this.useStatus = useStatus;
    }

    public String getWechatCertificatePath() {
        return wechatCertificatePath;
    }

    public void setWechatCertificatePath(String wechatCertificatePath) {
        this.wechatCertificatePath = wechatCertificatePath;
    }

    @Override
    public String toString() {
        return "MallWechatConfig{" +
                "appid='" + appid + '\'' +
                ", appSecret='" + appSecret + '\'' +
                ", appid3rd='" + appid3rd + '\'' +
                ", appSecret3rd='" + appSecret3rd + '\'' +
                ", configKey='" + configKey + '\'' +
                ", mallId=" + mallId +
                ", mchid='" + mchid + '\'' +
                ", notifyUrl='" + notifyUrl + '\'' +
                ", useStatus=" + useStatus +
                ", wechatCertificatePath='" + wechatCertificatePath + '\'' +
                '}';
    }
}
